<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        
        function add(a,b){
            return a+b;
        }

        function log(str){
            console.log(`日志:${str}`);
            return str;
        }

       function  *Demo(){
           const sum=yield add(100,150);
            yield log(sum);
            // yield 'world';
            // yield '!!!';
       }     



       var demo=Demo();
       const first=demo.next();
       const second=demo.next(first.value);
    //    const third=demo.next();
    //    const last=demo.next();

       console.log(first,second);


        
    </script>
</body>
</html>